local function main(userOb, msgData)
    if not msgData.GoodFriendId then
        return
    end    
    local result = {}
    local userId = userOb:query_temp("userId")
    local rpc = {}
    rpc.from_user = userId
    rpc.to_user = msgData.GoodFriendId
    rpc.type = 0
    rpc.behavior = "add"
    rpc.method = "change_task"
    local ok, data = THREAD_D:send("database_yield", rpc) 

    result.code = 200
    result.status = "success"

    userOb:send_packet("MSGS2CGoodFriendAdd", result)  
end

--注册方法
COMMAND_D:register_command("MSGC2SGoodFriendAdd",GameCmdType.NONE, main)